Skip to content

feat(fleet): queue domain — repo-queue client + broker roles in pkgs/fleet (step 2, #5430) - #5478

Merged
dezren39 merged 1 commit into
mainfrom
fleet-step2-queue
Nov 4, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fleet-step2-queue

Conversation

@dezren39

@dezren39 dezren39 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

What

Fleet epic step 2 (#5430): the queue domain lands in pkgs/fleet, and the laptop's live queue stack migrates onto it, one verified flip at a time.

  • crates/fleet-queue — the broker family (sandbox ~/tools/fleet-brokers, code#5362) gets its first source home in this repo: the repo-queue client, the queue-broker and secrets-broker serve roles, and packet validation, refactored onto the platform crates. Credentials resolve by name through fleet-secrets (the queue-broker's source is a SecretSource over the secrets-broker HTTP API; the secrets-broker refresh runs bws through the CommandRunner seam); one structured logging facility (src/log.rs) with the domain as a field replaces the ad-hoc prefixes, byte-identical stderr. Wire behavior preserved: HTTP surface, envelopes, framing, exit codes, stdout shapes (preserve_order where consumers read key order).
  • repo-queue surface fix (census gap) — --help renders from the fleet registry; --version reports the release through the argv0 route. fleet queue … is the same surface.
  • Standalone artifacts keep building — the fleet-brokers package builds repo-queue / queue-broker / secrets-broker from src/bin shims over the same library: the migration's rollback inventory.
  • fleet-static — full profile, musl static, for non-nix install contexts (linkage is a per-context choice, refinement B). The sandbox's repo-queue flip installs this artifact.
  • Home module — home/common/default.nix gains secrets-broker / queue-broker user units running fleet serve <role> (one unit per role), the dezren39/nix PR ops(dashboard): daily backups of dashboard/orchestration logs + stores — laptop, Google Drive, R2 #1459 pattern ported into this tree per ruling D1, consuming this flake's own pkgs/fleet (atlas-search toolchain pattern). Hand-installed unit files converge on the next activation.

Live migration (all verified 2026-11-04, evidence on #5430)

  1. secrets-broker unit → fleet serve secrets-broker — health + /secret shape + round-trip on credentials it served (task 9546).
  2. queue-broker unit → fleet serve queue-broker — round-trip from the sandbox consumer client (task 9547); production-queue reads verified from the laptop claimant's path.
  3. Sandbox ~/tools/bin/repo-queue symlink → fleet-static artifact — round-trip task 9548; --help/--version live.
  • Rollback exercised, not assumed: the standalone fleet-brokers stack ran a full scratch round-trip (task 9549); pre-flip unit files kept as *.pre-fleet-step2; original binaries untouched in ~/fleet-brokers/bin.

Verification

  • cargo test --workspace green; clippy clean (rustup 1.99.0 toolchain bin first in PATH, RUSTC_WRAPPER= — the laptop's clippy-driver/sccache trap).
  • nix build of all six outputs green (check phases run the per-package test suites).
  • pkgs/fleet/smoke.sh: 42 passed, 0 failed (step-1 suite plus queue-domain sections: roles bind and answer on scratch ports, client surface, client→broker wiring).
  • Pre-flip scratch proofs: fleet secrets-broker refreshed the real vault (114 secrets); fleet queue-broker served a full enqueue→claim→complete against it.

Notes for reviewers

  • SecretValue::from_resolved is a new public constructor in fleet-secrets: sources outside the crate could not otherwise construct the newtype (step 1 shipped it without one).
  • The secrets-broker's bws failure errors no longer embed a trimmed bws stderr excerpt — the platform CommandRunner contract carries exit status only, never output. Deliberate: errors carry names/status, never values.
  • Operational findings recorded on fleet step 2: queue domain pilot — brokers into pkgs/fleet, one-flip-at-a-time migration #5430 (workers-table FK on claim; the repo_queue_health view intermittently timing out platform-wide, identical on the pre-fleet broker).

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…fleet (step 2, #5430)

Port the broker family (sandbox ~/tools/fleet-brokers, code#5362)
into pkgs/fleet as crates/fleet-queue: the repo-queue client, the
queue-broker and secrets-broker serve roles, and packet validation,
refactored onto the platform crates — credentials resolve by name
through fleet-secrets (the queue-broker source is a SecretSource
over the secrets-broker HTTP API; the secrets-broker refresh runs
bws through the CommandRunner seam), and all three programs share
one structured logging facility (src/log.rs) with the domain as a
field, byte-identical stderr to the ad-hoc prefixes it replaces.
Wire behavior is preserved: same HTTP surface, envelopes, framing,
exit codes, and stdout shapes (serde_json preserve_order where the
consumers read key order).

repo-queue gains the surface the census found missing: --help
renders from the fleet registry and --version reports the release
through the argv0 route (fleet queue equally).

The brokers keep building as standalone artifacts (the
fleet-brokers package: repo-queue / queue-broker / secrets-broker
from src/bin shims over the same library) — the migration rollback
inventory. A fleet-static (full profile, musl) artifact joins the
variant set for non-nix install contexts. The broker systemd user
units land in home/common/default.nix as fleet serve <role>
definitions — the dezren39/nix PR #1459 module pattern ported into
this tree per ruling D1, consuming this flake's own packages.

Live migration evidence (per-flip round-trips, rollback exercise)
is recorded on #5430.
@dezren39
dezren39 requested a review from a team as a code owner November 4, 2026 13:45
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd1af07c-4d29-467e-a62d-441a7523ebbe
Commits

Reviewing files that changed from the base of the PR and between 5feb07e and a9d10ac.

Files ignored due to path filters: 1
  • pkgs/fleet/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 20
  • home/common/default.nix
  • lib/default.nix
  • pkgs/fleet/.gitignore
  • pkgs/fleet/Cargo.toml
  • pkgs/fleet/README.md
  • pkgs/fleet/crates/fleet-queue/Cargo.toml
  • pkgs/fleet/crates/fleet-queue/src/bin/queue-broker.rs
  • pkgs/fleet/crates/fleet-queue/src/bin/repo-queue.rs
  • pkgs/fleet/crates/fleet-queue/src/bin/secrets-broker.rs
  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/lib.rs
  • pkgs/fleet/crates/fleet-queue/src/log.rs
  • pkgs/fleet/crates/fleet-queue/src/queue_broker.rs
  • pkgs/fleet/crates/fleet-queue/src/secrets_broker.rs
  • pkgs/fleet/crates/fleet-queue/src/validate.rs
  • pkgs/fleet/crates/fleet-secrets/src/lib.rs
  • pkgs/fleet/crates/fleet/Cargo.toml
  • pkgs/fleet/crates/fleet/src/main.rs
  • pkgs/fleet/default.nix
  • pkgs/fleet/smoke.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit cefda11 into main Nov 4, 2026
3 checks passed
@dezren39
dezren39 deleted the fleet-step2-queue branch November 4, 2026 13:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T13:46:37.664862Z a9d10ac PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant